package cn.yotta.user.web.autoconfiguration.context.tenant;

/**
 * @author wyaoyao
 * @date 2022/11/8 16:48
 */
public class TenantContext {

    private final static ThreadLocal<Long> TENANT_LOCAL = new ThreadLocal<>();

    private TenantContext() {
    }

    public static void setTenantId(Long id){
        TENANT_LOCAL.set(id);
    }

    public static Long getTenantId(){
        return TENANT_LOCAL.get();
    }


    public static void clear(){
        TENANT_LOCAL.remove();
    }
}
